﻿using System;
using Microsoft.Xna.Framework;

namespace Terraria.DataStructures
{
	// Token: 0x02000483 RID: 1155
	public struct Point16
	{
		// Token: 0x060026CB RID: 9931 RVA: 0x0001AFFF File Offset: 0x000191FF
		public Point16(Point point)
		{
			this.X = (short)point.X;
			this.Y = (short)point.Y;
		}

		// Token: 0x060026CC RID: 9932 RVA: 0x0001B01B File Offset: 0x0001921B
		public Point16(int X, int Y)
		{
			this.X = (short)X;
			this.Y = (short)Y;
		}

		// Token: 0x060026CD RID: 9933 RVA: 0x0001B02D File Offset: 0x0001922D
		public Point16(short X, short Y)
		{
			this.X = X;
			this.Y = Y;
		}

		// Token: 0x060026CE RID: 9934 RVA: 0x0001B03D File Offset: 0x0001923D
		public Point16(int size)
		{
			this.X = (short)size;
			this.Y = (short)size;
		}

		// Token: 0x060026CF RID: 9935 RVA: 0x0001B04F File Offset: 0x0001924F
		public Point16(short size)
		{
			this.X = size;
			this.Y = size;
		}

		// Token: 0x060026D0 RID: 9936 RVA: 0x0001B05F File Offset: 0x0001925F
		public static Point16 Max(int firstX, int firstY, int secondX, int secondY)
		{
			return new Point16((firstX > secondX) ? firstX : secondX, (firstY > secondY) ? firstY : secondY);
		}

		// Token: 0x060026D1 RID: 9937 RVA: 0x0001B076 File Offset: 0x00019276
		public Point16 Max(int compareX, int compareY)
		{
			return new Point16(((int)this.X > compareX) ? ((int)this.X) : compareX, ((int)this.Y > compareY) ? ((int)this.Y) : compareY);
		}

		// Token: 0x060026D2 RID: 9938 RVA: 0x0001B0A1 File Offset: 0x000192A1
		public Point16 Max(Point16 compareTo)
		{
			return new Point16((this.X > compareTo.X) ? this.X : compareTo.X, (this.Y > compareTo.Y) ? this.Y : compareTo.Y);
		}

		// Token: 0x060026D3 RID: 9939 RVA: 0x0001B0E0 File Offset: 0x000192E0
		public static Point16 operator +(Point16 first, Point16 second)
		{
			return new Point16((int)(first.X + second.X), (int)(first.Y + second.Y));
		}

		// Token: 0x060026D4 RID: 9940 RVA: 0x0001B101 File Offset: 0x00019301
		public static Point16 operator -(Point16 first, Point16 second)
		{
			return new Point16((int)(first.X - second.X), (int)(first.Y - second.Y));
		}

		// Token: 0x060026D5 RID: 9941 RVA: 0x0001B122 File Offset: 0x00019322
		public static Point16 operator *(Point16 first, Point16 second)
		{
			return new Point16((int)(first.X * second.X), (int)(first.Y * second.Y));
		}

		// Token: 0x060026D6 RID: 9942 RVA: 0x0001B143 File Offset: 0x00019343
		public static Point16 operator /(Point16 first, Point16 second)
		{
			return new Point16((int)(first.X / second.X), (int)(first.Y / second.Y));
		}

		// Token: 0x060026D7 RID: 9943 RVA: 0x0001B164 File Offset: 0x00019364
		public static Point16 operator %(Point16 first, int num)
		{
			return new Point16((int)first.X % num, (int)first.Y % num);
		}

		// Token: 0x060026D8 RID: 9944 RVA: 0x0001B17B File Offset: 0x0001937B
		public static bool operator ==(Point16 first, Point16 second)
		{
			return first.X == second.X && first.Y == second.Y;
		}

		// Token: 0x060026D9 RID: 9945 RVA: 0x0001B19B File Offset: 0x0001939B
		public static bool operator !=(Point16 first, Point16 second)
		{
			return first.X != second.X || first.Y != second.Y;
		}

		// Token: 0x060026DA RID: 9946 RVA: 0x00493004 File Offset: 0x00491204
		public override bool Equals(object obj)
		{
			Point16 point = (Point16)obj;
			return this.X == point.X && this.Y == point.Y;
		}

		// Token: 0x060026DB RID: 9947 RVA: 0x0001B1BE File Offset: 0x000193BE
		public override int GetHashCode()
		{
			return (int)this.X << 16 | (int)((ushort)this.Y);
		}

		// Token: 0x060026DC RID: 9948 RVA: 0x0001B1D1 File Offset: 0x000193D1
		public override string ToString()
		{
			return string.Format("{{{0}, {1}}}", this.X, this.Y);
		}

		// Token: 0x04004383 RID: 17283
		public readonly short X;

		// Token: 0x04004384 RID: 17284
		public readonly short Y;

		// Token: 0x04004385 RID: 17285
		public static Point16 Zero = new Point16(0, 0);

		// Token: 0x04004386 RID: 17286
		public static Point16 NegativeOne = new Point16(-1, -1);
	}
}
